import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class Test1 {
    public static void main(String[] args) {
        ArrayList<Integer> li=new ArrayList();
        //2.添加整数
        Collections.addAll(li,1,2,3,4,5,6,7,8,9,10);
        //过滤
        List<Integer> collect = li.stream().filter(s -> s % 2 == 0)
                .collect(Collectors.toList());
        //3.打印
        System.out.println(collect);
    }
}
